package com.iot.service.mqtt.service.auth;

import com.iot.service.mqtt.config.TlAuthProperties;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author: hszhou
 * @Date: 2025/5/12 10:57
 * @Description: 是否开启认证 如果不开启 那么就无效认证
 */
@Service
@RequiredArgsConstructor
@Slf4j
public class NoneAuthenticationService extends AbstractTlAuthentication{

    private final TlAuthProperties authProperties;;
    @Override
    public boolean authenticate(String username, String password) {
        return true;
    }

    @Override
    public boolean enabled() {
        return !authProperties.isEnabled();
    }
}
